//
//  ZZTNetEngine.h
//  ZZTong
//
//  Created by xy on 13-5-10.
//  Copyright (c) 2013年 handpay. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NSNetLib.h"

#define NET_RESPONSE_CODE           @"responseCode"
#define NET_ERROR_MESSAGE           @"errMessage"
#define NET_RESPONSE_SUCCESS        @"0"

typedef enum{
    VerifyVerionStatus_NONE = 0,  // 版本检测未执行
    VerifyVerionStatus_Success = 1, // 版本检测成功
    VerifyVerionStatus_Failed = 2, // 版本检测失败
}VerifyVerionStatus;

@interface ZZTongNetEngine : NSObject{
    VerifyVerionStatus verifyVerionStatus; // 版本检测协议完成标识，YES--成功
    NSNetData* verifyVersionData; // 版本检测数据
    NSNetData* lastReqData;   // 保存本次请求的数据，如果版本检测没过，先执行版本检测
}
@property(nonatomic)VerifyVerionStatus verifyVerionStatus;
@property(nonatomic, retain)NSNetData* verifyVersionData;
@property(nonatomic, retain)NSNetData* lastReqData;

-(void)sendRequest:(NSString*)action withParams:(NSDictionary*)params withDelegate:(id<NetCallBackDelegate>)delegate;
-(void)sendRequest:(NSString*)action withParams:(NSDictionary*)params withDelegate:(id<NetCallBackDelegate>)delegate withAddress:(NSString*)addrName;
-(void)sendRequest:(NSString*)action withParams:(NSDictionary*)params withDelegate:(id<NetCallBackDelegate>)delegate withAlertFlag:(BOOL)isShowAlert;
-(void)sendRequest:(NSString*)action withParams:(NSDictionary*)params withDelegate:(id<NetCallBackDelegate>)delegate withAddress:(NSString*)addrName withAlertFlag:(BOOL)isShowAlert;
-(void)sendRequest:(NSString*)action withParams:(NSDictionary*)params withDelegate:(id<NetCallBackDelegate>)delegate withUploadImg:(BOOL)upload;
@end
